/*
 * XML Type:  InvestmentPosition
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.InvestmentPosition
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML InvestmentPosition(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class InvestmentPositionImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.InvestmentPosition
{
    
    public InvestmentPositionImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SECID$0 = 
        new javax.xml.namespace.QName("", "SECID");
    private static final javax.xml.namespace.QName HELDINACCT$2 = 
        new javax.xml.namespace.QName("", "HELDINACCT");
    private static final javax.xml.namespace.QName POSTYPE$4 = 
        new javax.xml.namespace.QName("", "POSTYPE");
    private static final javax.xml.namespace.QName UNITS$6 = 
        new javax.xml.namespace.QName("", "UNITS");
    private static final javax.xml.namespace.QName UNITPRICE$8 = 
        new javax.xml.namespace.QName("", "UNITPRICE");
    private static final javax.xml.namespace.QName MKTVAL$10 = 
        new javax.xml.namespace.QName("", "MKTVAL");
    private static final javax.xml.namespace.QName DTPRICEASOF$12 = 
        new javax.xml.namespace.QName("", "DTPRICEASOF");
    private static final javax.xml.namespace.QName CURRENCY$14 = 
        new javax.xml.namespace.QName("", "CURRENCY");
    private static final javax.xml.namespace.QName MEMO$16 = 
        new javax.xml.namespace.QName("", "MEMO");
    private static final javax.xml.namespace.QName INV401KSOURCE$18 = 
        new javax.xml.namespace.QName("", "INV401KSOURCE");
    
    
    /**
     * Gets the "SECID" element
     */
    public net.ofx.types.x2003.x04.SecurityId getSECID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().find_element_user(SECID$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "SECID" element
     */
    public void setSECID(net.ofx.types.x2003.x04.SecurityId secid)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().find_element_user(SECID$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SecurityId)get_store().add_element_user(SECID$0);
            }
            target.set(secid);
        }
    }
    
    /**
     * Appends and returns a new empty "SECID" element
     */
    public net.ofx.types.x2003.x04.SecurityId addNewSECID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().add_element_user(SECID$0);
            return target;
        }
    }
    
    /**
     * Gets the "HELDINACCT" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum.Enum getHELDINACCT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(HELDINACCT$2, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.SubAccountEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "HELDINACCT" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum xgetHELDINACCT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(HELDINACCT$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "HELDINACCT" element
     */
    public void setHELDINACCT(net.ofx.types.x2003.x04.SubAccountEnum.Enum heldinacct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(HELDINACCT$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(HELDINACCT$2);
            }
            target.setEnumValue(heldinacct);
        }
    }
    
    /**
     * Sets (as xml) the "HELDINACCT" element
     */
    public void xsetHELDINACCT(net.ofx.types.x2003.x04.SubAccountEnum heldinacct)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(HELDINACCT$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().add_element_user(HELDINACCT$2);
            }
            target.set(heldinacct);
        }
    }
    
    /**
     * Gets the "POSTYPE" element
     */
    public net.ofx.types.x2003.x04.PositionTypeEnum.Enum getPOSTYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(POSTYPE$4, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.PositionTypeEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "POSTYPE" element
     */
    public net.ofx.types.x2003.x04.PositionTypeEnum xgetPOSTYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionTypeEnum target = null;
            target = (net.ofx.types.x2003.x04.PositionTypeEnum)get_store().find_element_user(POSTYPE$4, 0);
            return target;
        }
    }
    
    /**
     * Sets the "POSTYPE" element
     */
    public void setPOSTYPE(net.ofx.types.x2003.x04.PositionTypeEnum.Enum postype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(POSTYPE$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(POSTYPE$4);
            }
            target.setEnumValue(postype);
        }
    }
    
    /**
     * Sets (as xml) the "POSTYPE" element
     */
    public void xsetPOSTYPE(net.ofx.types.x2003.x04.PositionTypeEnum postype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositionTypeEnum target = null;
            target = (net.ofx.types.x2003.x04.PositionTypeEnum)get_store().find_element_user(POSTYPE$4, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.PositionTypeEnum)get_store().add_element_user(POSTYPE$4);
            }
            target.set(postype);
        }
    }
    
    /**
     * Gets the "UNITS" element
     */
    public java.lang.String getUNITS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(UNITS$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "UNITS" element
     */
    public net.ofx.types.x2003.x04.QuantityType xgetUNITS()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.QuantityType target = null;
            target = (net.ofx.types.x2003.x04.QuantityType)get_store().find_element_user(UNITS$6, 0);
            return target;
        }
    }
    
    /**
     * Sets the "UNITS" element
     */
    public void setUNITS(java.lang.String units)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(UNITS$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(UNITS$6);
            }
            target.setStringValue(units);
        }
    }
    
    /**
     * Sets (as xml) the "UNITS" element
     */
    public void xsetUNITS(net.ofx.types.x2003.x04.QuantityType units)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.QuantityType target = null;
            target = (net.ofx.types.x2003.x04.QuantityType)get_store().find_element_user(UNITS$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.QuantityType)get_store().add_element_user(UNITS$6);
            }
            target.set(units);
        }
    }
    
    /**
     * Gets the "UNITPRICE" element
     */
    public java.lang.String getUNITPRICE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(UNITPRICE$8, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "UNITPRICE" element
     */
    public net.ofx.types.x2003.x04.UnitPriceType xgetUNITPRICE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.UnitPriceType target = null;
            target = (net.ofx.types.x2003.x04.UnitPriceType)get_store().find_element_user(UNITPRICE$8, 0);
            return target;
        }
    }
    
    /**
     * Sets the "UNITPRICE" element
     */
    public void setUNITPRICE(java.lang.String unitprice)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(UNITPRICE$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(UNITPRICE$8);
            }
            target.setStringValue(unitprice);
        }
    }
    
    /**
     * Sets (as xml) the "UNITPRICE" element
     */
    public void xsetUNITPRICE(net.ofx.types.x2003.x04.UnitPriceType unitprice)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.UnitPriceType target = null;
            target = (net.ofx.types.x2003.x04.UnitPriceType)get_store().find_element_user(UNITPRICE$8, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.UnitPriceType)get_store().add_element_user(UNITPRICE$8);
            }
            target.set(unitprice);
        }
    }
    
    /**
     * Gets the "MKTVAL" element
     */
    public java.lang.String getMKTVAL()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MKTVAL$10, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "MKTVAL" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetMKTVAL()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(MKTVAL$10, 0);
            return target;
        }
    }
    
    /**
     * Sets the "MKTVAL" element
     */
    public void setMKTVAL(java.lang.String mktval)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MKTVAL$10, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MKTVAL$10);
            }
            target.setStringValue(mktval);
        }
    }
    
    /**
     * Sets (as xml) the "MKTVAL" element
     */
    public void xsetMKTVAL(net.ofx.types.x2003.x04.AmountType mktval)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(MKTVAL$10, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(MKTVAL$10);
            }
            target.set(mktval);
        }
    }
    
    /**
     * Gets the "DTPRICEASOF" element
     */
    public java.lang.String getDTPRICEASOF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DTPRICEASOF$12, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "DTPRICEASOF" element
     */
    public net.ofx.types.x2003.x04.DateTimeType xgetDTPRICEASOF()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.DateTimeType target = null;
            target = (net.ofx.types.x2003.x04.DateTimeType)get_store().find_element_user(DTPRICEASOF$12, 0);
            return target;
        }
    }
    
    /**
     * Sets the "DTPRICEASOF" element
     */
    public void setDTPRICEASOF(java.lang.String dtpriceasof)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DTPRICEASOF$12, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DTPRICEASOF$12);
            }
            target.setStringValue(dtpriceasof);
        }
    }
    
    /**
     * Sets (as xml) the "DTPRICEASOF" element
     */
    public void xsetDTPRICEASOF(net.ofx.types.x2003.x04.DateTimeType dtpriceasof)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.DateTimeType target = null;
            target = (net.ofx.types.x2003.x04.DateTimeType)get_store().find_element_user(DTPRICEASOF$12, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.DateTimeType)get_store().add_element_user(DTPRICEASOF$12);
            }
            target.set(dtpriceasof);
        }
    }
    
    /**
     * Gets the "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency getCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$14, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "CURRENCY" element
     */
    public boolean isSetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CURRENCY$14) != 0;
        }
    }
    
    /**
     * Sets the "CURRENCY" element
     */
    public void setCURRENCY(net.ofx.types.x2003.x04.Currency currency)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$14, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$14);
            }
            target.set(currency);
        }
    }
    
    /**
     * Appends and returns a new empty "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency addNewCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$14);
            return target;
        }
    }
    
    /**
     * Unsets the "CURRENCY" element
     */
    public void unsetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CURRENCY$14, 0);
        }
    }
    
    /**
     * Gets the "MEMO" element
     */
    public java.lang.String getMEMO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MEMO$16, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "MEMO" element
     */
    public net.ofx.types.x2003.x04.MessageType xgetMEMO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MessageType target = null;
            target = (net.ofx.types.x2003.x04.MessageType)get_store().find_element_user(MEMO$16, 0);
            return target;
        }
    }
    
    /**
     * True if has "MEMO" element
     */
    public boolean isSetMEMO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MEMO$16) != 0;
        }
    }
    
    /**
     * Sets the "MEMO" element
     */
    public void setMEMO(java.lang.String memo)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MEMO$16, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MEMO$16);
            }
            target.setStringValue(memo);
        }
    }
    
    /**
     * Sets (as xml) the "MEMO" element
     */
    public void xsetMEMO(net.ofx.types.x2003.x04.MessageType memo)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.MessageType target = null;
            target = (net.ofx.types.x2003.x04.MessageType)get_store().find_element_user(MEMO$16, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.MessageType)get_store().add_element_user(MEMO$16);
            }
            target.set(memo);
        }
    }
    
    /**
     * Unsets the "MEMO" element
     */
    public void unsetMEMO()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MEMO$16, 0);
        }
    }
    
    /**
     * Gets the "INV401KSOURCE" element
     */
    public net.ofx.types.x2003.x04.Investment401KSourceEnum.Enum getINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INV401KSOURCE$18, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.Investment401KSourceEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "INV401KSOURCE" element
     */
    public net.ofx.types.x2003.x04.Investment401KSourceEnum xgetINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Investment401KSourceEnum target = null;
            target = (net.ofx.types.x2003.x04.Investment401KSourceEnum)get_store().find_element_user(INV401KSOURCE$18, 0);
            return target;
        }
    }
    
    /**
     * True if has "INV401KSOURCE" element
     */
    public boolean isSetINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(INV401KSOURCE$18) != 0;
        }
    }
    
    /**
     * Sets the "INV401KSOURCE" element
     */
    public void setINV401KSOURCE(net.ofx.types.x2003.x04.Investment401KSourceEnum.Enum inv401KSOURCE)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INV401KSOURCE$18, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INV401KSOURCE$18);
            }
            target.setEnumValue(inv401KSOURCE);
        }
    }
    
    /**
     * Sets (as xml) the "INV401KSOURCE" element
     */
    public void xsetINV401KSOURCE(net.ofx.types.x2003.x04.Investment401KSourceEnum inv401KSOURCE)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Investment401KSourceEnum target = null;
            target = (net.ofx.types.x2003.x04.Investment401KSourceEnum)get_store().find_element_user(INV401KSOURCE$18, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Investment401KSourceEnum)get_store().add_element_user(INV401KSOURCE$18);
            }
            target.set(inv401KSOURCE);
        }
    }
    
    /**
     * Unsets the "INV401KSOURCE" element
     */
    public void unsetINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(INV401KSOURCE$18, 0);
        }
    }
}
